<!--新增会员-->
<template>
  <section class="webview fixHeight">
    <el-scrollbar style="height:100%">
      <!--      经纪人-->
      <el-form  ref="form" :model="detail" label-width="100px" class="form">
        
       
        <el-form-item label="经纪人名字">
          <el-input v-model="detail.name" />
        </el-form-item>
        <el-form-item label="手机号">
          <el-input v-model="detail.phone" />
        </el-form-item>
        <el-form-item label="提交时间">
           <el-input v-model="detail.createAt" />
        </el-form-item>
        <el-form-item label="所属公司" v-if='type==1'>
          <el-input v-model="detail.enterpriseName" />
        </el-form-item>
       <el-form-item label="所属门店" v-if='type==1'>
         <el-input v-model="detail.storeName" />
       </el-form-item>
        <el-form-item label="状态">
          <el-input v-model="detail.status" />
        </el-form-item>
		<el-form-item label="身份证正面">
		 <img style="width: 160px;" :src="detail.idcardFront" alt="">
		</el-form-item>
		<el-form-item label="身份证反面">
		 <img style="width: 160px;" :src="detail.idcardRear" alt="">
		</el-form-item>
		<el-form-item label="工牌">
		 <img style="width: 160px;" :src="detail.workCard" alt="">
		</el-form-item>
     <el-form-item>
<!--          <el-button type="primary" @click="submit">提交</el-button>-->
          <el-button @click="cancel">返回</el-button>
          <el-button @click="ok">通过</el-button>
          <el-button @click="back">打回</el-button>
        </el-form-item>
      </el-form>
      
     
      
    </el-scrollbar>
  </section>
</template>
<script>
  import {agentUpdateStatus} from '@/api/api'
  export default {
    data() {
      return {
       
        detail: {
			id:0,
			type:0
		}
      }
    },
    created() {
     
		var data=JSON.parse( this.$route.query.data );
		this.type= this.$route.query.type ;
        
            this.detail = data
           this.id=data.id
        
        
    },
    methods: {
		ok(){
			var that=this;
			agentUpdateStatus({
			  id: that.id,
			  status: 0,
			  type:that.type
			}).then(data => {
			  Is.tip('设置成功')
			   this.$router.go(-1)
			})
		},
		back(){
			var that=this;
			this.$prompt('请输入打回理由', '提示', {
			          confirmButtonText: '确定',
			          cancelButtonText: '取消'
			        }).then(({ value }) => {
						agentUpdateStatus({
						  id: that.id,
						  status:4,
						  remark:value,
							type:that.type
						}).then(data => {
						  Is.tip('设置成功');
						   this.$router.go(-1)
						});
			        }).catch(() => {
			               
			        });
				  		 
			
		}
    }}
</script>
